<?php

class Form_Admin_Deals extends Form_Custom_General {

    public function init() {
		
		$deal_name = $this->createElement("text", "deal_name")
				->setRequired(TRUE)
				->addValidator("NotEmpty", true, array("messages" => array("isEmpty" => "Please enter name")))
				->addFilters(array(
					 new Zend_Filter_StringTrim(),
				))
				->setAttribs(Array("class"=>"form-control","placeholder"=>"Name"));
        $this->addElement($deal_name);
		
		$deal_stage = $this->createElement("select", "deal_stage")
				->setRequired(TRUE)
				->addValidator("NotEmpty", true, array("messages" => array("isEmpty" => "Please select deal stage")))
				->addFilters(array(
					 new Zend_Filter_StringTrim(),
				))
				->setAttribs(Array("class"=>"","placeholder"=>""));
        $this->addElement($deal_stage);
		
		$deal_currency = $this->createElement("select", "deal_currency")
				->setRequired(FALSE)
				->addValidator("NotEmpty", true, array("messages" => array("isEmpty" => "")))
				->addFilters(array(
					 new Zend_Filter_StringTrim(),
				))
				->setAttribs(Array("class"=>"form-control","placeholder"=>"Deal Currency"));
        $this->addElement($deal_currency);
		
		$deal_income = $this->createElement("text", "deal_income")
				->setRequired(FALSE)
				->addValidator("NotEmpty", true, array("messages" => array("isEmpty" => "")))
				->addFilters(array(
					 new Zend_Filter_StringTrim(),
				))
				->setAttribs(Array("class"=>"form-control","placeholder"=>"Deal Income"));
        $this->addElement($deal_income);
		
		$deal_probability = $this->createElement("text", "deal_probability")
				->setRequired(FALSE)
				->addValidator("NotEmpty", true, array("messages" => array("isEmpty" => "")))
				->addFilters(array(
					 new Zend_Filter_StringTrim(),
				))
				->setAttribs(Array("class"=>"form-control","placeholder"=>"Probability"));
        $this->addElement($deal_probability);
		
		$deal_responsible = $this->createElement("text", "deal_responsible")
				->setRequired(FALSE)
				->addValidator("NotEmpty", true, array("messages" => array("isEmpty" => "")))
				->addFilters(array(
					 new Zend_Filter_StringTrim(),
				))
				->setAttribs(Array("class"=>"form-control","placeholder"=>"Currency"));
        $this->addElement($deal_responsible);
		
		$deal_startdate = $this->createElement("text", "deal_startdate")
				->setRequired(FALSE)
				->addValidator("NotEmpty", true, array("messages" => array("isEmpty" => "")))
				->addFilters(array(
					 new Zend_Filter_StringTrim(),
				))
				->setAttribs(Array("class"=>"form-control form_datetime","placeholder"=>"",'readonly' => 'true'));
        $this->addElement($deal_startdate);
		
		$deal_enddate = $this->createElement("text", "deal_enddate")
				->setRequired(FALSE)
				->addValidator("NotEmpty", true, array("messages" => array("isEmpty" => "")))
				->addFilters(array(
					 new Zend_Filter_StringTrim(),
				))
				->setAttribs(Array("class"=>"form-control form_datetime","placeholder"=>"",'readonly' => 'true'));
        $this->addElement($deal_enddate);
		
		$deal_type = $this->createElement("select", "deal_type")
				->setRequired(TRUE)
				->addValidator("NotEmpty", true, array("messages" => array("isEmpty" => "Please enter deal type")))
				->addFilters(array(
					 new Zend_Filter_StringTrim(),
				))
				->setAttribs(Array("class"=>"","placeholder"=>""));
        $this->addElement($deal_type);
		
		$deal_available_to_everyone = $this->createElement("text", "deal_available_to_everyone")
				->setRequired(FALSE)
				->addValidator("NotEmpty", true, array("messages" => array("isEmpty" => "")))
				->addFilters(array(
					 new Zend_Filter_StringTrim(),
				))
				->setAttribs(Array("class"=>"form-control","placeholder"=>""));
        $this->addElement($deal_available_to_everyone);
		
		$deal_clnt_id = $this->createElement("select", "deal_clnt_id")
				->setRequired(TRUE)
				->addValidator("NotEmpty", true, array("messages" => array("isEmpty" => "Please select client name")))
				->addFilters(array(
					 new Zend_Filter_StringTrim(),
				))
				->setAttribs(Array("class"=>"","placeholder"=>""));
        $this->addElement($deal_clnt_id);
		
		$deal_comment = $this->createElement("textarea", "deal_comment")
				->setRequired(FALSE)
				->addValidator("NotEmpty", true, array("messages" => array("isEmpty" => "")))
				->addFilters(array(
					 new Zend_Filter_StringTrim(),
				))
				->setAttribs(Array("class"=>"form-control","cols" => "15", "rows" => "5","placeholder"=>"Comment"));
        $this->addElement($deal_comment);
		
        $comp_addedby = $this->createElement('text', 'comp_addedby')
               ->addFilters(array(
                    new Zend_Filter_StringTrim(),
                ))
                ->setAttribs(Array('class' => "form-control", "readonly"=>"readonly", "placeholder" => ""));
        $this->addElement($comp_addedby);
        
        $comp_updatedby = $this->createElement('text', 'comp_updatedby')
               ->addFilters(array(
                    new Zend_Filter_StringTrim(),
                ))
                ->setAttribs(Array('class' => "form-control","readonly"=>"readonly", "placeholder" => ""));
        $this->addElement($comp_updatedby);
		
		$deal_status = $this->createElement("select", "deal_status")
				->setRequired(TRUE)
				->addValidator("NotEmpty", true, array("messages" => array("isEmpty" => "Please enter status")))
				->addFilters(array(
					 new Zend_Filter_StringTrim(),
				))
				->setAttribs(Array("class"=>"form-control","placeholder"=>"Status"));
		$this->addElement($deal_status);
		
		$submit = $this->createElement('submit', 'Save')
                ->setAttribs(Array('title' => "Save changes", 'class' => "btn-glow primary"));
        $this->addElement($submit);

        $reset = $this->createElement('reset', 'Reset')
                ->setAttribs(Array('title' => "Save changes and continue to edit", 'class' => "btn-glow primary"));
        $this->addElement($reset);
    }
}